package C7_8_IntroduceLocalExtension;

import java.util.Date;

/**
 * 使用子类 重构后
 */
public class MfDateSub extends Date {

    public MfDateSub(String dateString){
        super(dateString);
    }

    public MfDateSub(Date arg){
        super(arg.getTime());
    }

    Date nextDay(){
        return new Date(getYear(), getMonth(), getDate() + 1);
    }

    public static void main(String[] args) {
        Date date = new Date();
        MfDateSub mfDateWrap = new MfDateSub(date);
        System.out.println(mfDateWrap.nextDay());
    }

}
